package models

import (
	"time"
)

// RegisterTransaction 注册事务模型
type RegisterTransaction struct {
	Email       string    `json:"email" csv:"email"`
	Fingerprint string    `json:"fingerprint" csv:"fingerprint"`
	VerifyCode  string    `json:"verify_code" csv:"verify_code"`
	ExpiredAt   time.Time `json:"expired_at" csv:"expired_at"`
	CreatedAt   time.Time `json:"created_at" csv:"created_at"`
}

// IsExpired 检查验证码是否过期
func (rt *RegisterTransaction) IsExpired() bool {
	return rt.ExpiredAt.Before(time.Now())
}
